/*
 *  main.c
 *  PriceCompareDS
 *
 *  Created by Stacy Haponik on 5/26/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

#include <nds.h>
#include <stdio.h>
#include <fat.h>
#ifndef stores.c
#define stores.c
#endif

#ifndef prices.c
#define prices.c
#endif

#ifndef utilities.c
#define utilities.c
#endif


//---------------------------------------------------------------------------------
int main(void) {
	//---------------------------------------------------------------------------------
	//	irqInit(); 
	//	irqEnable(IRQ_VBLANK); 
	fatInitDefault();
	PrintConsole topScreen;
    PrintConsole bottomScreen;
    
    videoSetMode(MODE_0_2D);
    videoSetModeSub(MODE_0_2D);
	
    vramSetBankA(VRAM_A_MAIN_BG);
    vramSetBankC(VRAM_C_SUB_BG);
	
    consoleInit(&topScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
    consoleInit(&bottomScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
	
	consoleSelect(&topScreen);
	
	int screen=1;			//which screen should be shown? Options are (not all implemented)
	//	0: show shopping list
	//	1: show price entries
	//	2: stores
	//	3: calculator
	
	while(1) {
		if (screen==0){		//show shopping list
			iprintf("Shopping List\n");
		}
		if (screen==1){		// show information about  prices
			iprintf("Prices\n");
			screen=priceScreen();
		}
		if (screen==2){		// show information about stores
			iprintf("Stores\n");
			screen=storeScreen();
		}			
		if (screen==3){		// show calculator
			iprintf("Calculator\n");
		}
		
		swiWaitForVBlank();
	}
	
	return 0;
}